package com.camemax.rabbitmq.work_mode.round;

import com.camemax.rabbitmq.utils.ConsumersModulesRunnable;
import java.util.concurrent.TimeUnit;

// *********************
// ** @Date: 2021-06-09
// ** @Author: Camemax
// ** @Description: RabbitMQ Consumers consume messages in work mode [by Rounding].
// *********************
public class WorkRound_Consumer {
    private static final String QUEUENAME = "work-queue";
    private static final String CONSUMERA = "work-mode-consumerA";
    private static final String CONSUMERB = "work-mode-consumerB";
    public static void main(String[] args) {
        new Thread(new ConsumersModulesRunnable(QUEUENAME, true),CONSUMERA).start();
        // Thread sleeps for the Rounding result more easily
        try {
            TimeUnit.SECONDS.sleep(1);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        new Thread(new ConsumersModulesRunnable(QUEUENAME, true),CONSUMERB).start();
    }
}
